package com.common.platform.base.exception;

public class ServiceException extends RuntimeException {

    private Integer code;
    private String errorMessage;


    public ServiceException(Integer code, String errorMessage) {
        super(errorMessage);
        this.code = code;
        this.errorMessage = errorMessage;

    }

    public ServiceException(AbstractBaseExceptionEnum exception) {
        super(exception.getmessage());
        this.code = exception.getcode();
        this.errorMessage = exception.getmessage();
    }


    public Integer getCode(Integer code) {
        return this.code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getErrorMessage(String errorMessage) {
        return this.errorMessage;
    }

    public void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
    }
}
